package com.xpsoft.oa.service.admin.impl;

import java.util.Date;
import java.util.List;

import com.xpsoft.core.service.impl.BaseServiceImpl;
import com.xpsoft.oa.dao.admin.MeetingDao;
import com.xpsoft.oa.model.admin.Meeting;
import com.xpsoft.oa.service.admin.MeetingService;



public class MeetingServiceImpl extends BaseServiceImpl<Meeting> implements
		MeetingService {
	private MeetingDao dao;

	public MeetingServiceImpl(MeetingDao dao) {
		super(dao);
		this.dao = dao;
	}

	public List<Meeting> getAllByTime(Date startTime, Date endTime) {
		String hql = "from Meeting m where (m.startTime<='" + startTime + "'"
				+ " and m.entTime>='" + startTime + "') or (m.startTime<='"
				+ endTime + "'" + " and m.entTime>='" + endTime
				+ "') or (m.startTime>='" + startTime + "'"
				+ " and m.entTime<='" + endTime + "')";

		return dao.findByHql(hql);
	}

}